package com.yulongtian.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yulongtian.utils.R;
import io.swagger.annotations.Api;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yulongTian
 * @create 2022-10-29 14:14
 */
@RestController
@Api(tags = "测试接口")
public class HelloController {

    @GetMapping("/hello")
    @ApiOperationSupport(order = 1)
    //设置权限
    @PreAuthorize("hasAuthority('system:dept:list')")
    public String hello() {
        return "hello";
    }

    @GetMapping("/testCors")
    public R testCors() {
        return R.ok().data("data","testCors");
    }

}
